From d5ade2359539648845a5854ed353b29367961d74 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 11:02:20 +0100 Subject: refactor(components): extract MetaItem from MetaList * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers. --- src/pages/article/[slug].tsx | 194 +++++++++++++++++++++---------------------- 1 file changed, 95 insertions(+), 99 deletions(-) (limited to 'src/pages/article/[slug].tsx') diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index 7875d1d..0cba7a6 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -15,10 +15,11 @@ import { PageLayout, SharingWidget, Spinner, - type MetaItemData, Time, type CommentData, Heading, + MetaList, + MetaItem, } from '../../components'; import { getAllArticlesSlugs, @@ -112,102 +113,6 @@ const ArticlePage: NextPageWithLayout = ({ const { content, id, intro, meta, title } = article; const { author, commentsCount, cover, dates, seo, thematics, topics } = meta; - const headerMeta: (MetaItemData | undefined)[] = [ - author - ? { - id: 'author', - label: intl.formatMessage({ - defaultMessage: 'Written by:', - description: 'ArticlePage: author label', - id: 'MJbZfX', - }), - value: author.name, - } - : undefined, - { - id: 'publication-date', - label: intl.formatMessage({ - defaultMessage: 'Published on:', - description: 'ArticlePage: publication date label', - id: 'RecdwX', - }), - value: